package com.hsylient.javase.chapter11.demo01;

import lombok.SneakyThrows;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;

public class ImplementsCallableTest {

    @SneakyThrows
    public static void main(String[] args) {
        ImplementsCallable EImplementsCallable = new ImplementsCallable();
        // 创建执行服务
        ExecutorService executorService = Executors.newFixedThreadPool(3);
        // 提交执行
        Future<Boolean> executedResult = executorService.submit(EImplementsCallable);
        // 获取结果
        Boolean aBoolean = executedResult.get();
        // 关闭服务
        executorService.shutdown();
    }
}
